package sessionbean;

import javax.annotation.PreDestroy;
import javax.ejb.Remove;
import javax.ejb.Stateful;

@Stateful
public class Counter implements CounterRemote {
	int times;
	public void count(){
		times++;
	}
	public int getTimes(){
		return times;
	}
	@Remove
	@Override
	//用户删除bean，无需方法内容
	public void remove() {}
	
	@PreDestroy
	public void  destroy(){
		System.out.println("destroy()");
	}
}
